package com.iretailer.report.dto;

import com.iretailer.report.util.TimeUtil;

import java.text.MessageFormat;
import java.time.ZonedDateTime;

/**
 * @Auther: xjw
 * @Date: 2019/9/26 0026 14:17
 * @Description:
 */
public class EasAlarmModel {

    private Long deviceId;
    private String mallId;
    private String mallName;
    private ZonedDateTime zonedDateTime;
    private String dateTime;
    private int alarmTimes;

    public String getAll_dateTime_Group() {
        if (this.dateTime != null) {
            return MessageFormat.format("All_{0}", this.dateTime);
        } else {
            return null;
        }
    }


    public String getMall_dateTime_Group() {
        if (this.dateTime != null) {
            return MessageFormat.format("{0}_{1}", this.mallId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getDevice_dateTime_Group() {
        if (dateTime != null) {
            return MessageFormat.format("{0}_{1}", this.deviceId, this.dateTime);
        } else {
            return null;
        }
    }

    public String getWeek_dateTime_Group() {
        if (this.dateTime != null && this.dateTime != null) {
            return MessageFormat.format("{0}_{1}", TimeUtil.getWeekOfLocalDate(TimeUtil.parse_LocalDateTime(dateTime).toLocalDate()));
        } else {
            return null;
        }
    }


    public Long getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }

    public String getMallId() {
        return mallId;
    }

    public void setMallId(String mallId) {
        this.mallId = mallId;
    }

    public String getMallName() {
        return mallName;
    }

    public void setMallName(String mallName) {
        this.mallName = mallName;
    }

    public ZonedDateTime getZonedDateTime() {
        return zonedDateTime;
    }

    public void setZonedDateTime(ZonedDateTime zonedDateTime) {
        this.zonedDateTime = zonedDateTime;
    }

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public int getAlarmTimes() {
        return alarmTimes;
    }

    public void setAlarmTimes(int alarmTimes) {
        this.alarmTimes = alarmTimes;
    }
}
